<template>
  <div class="more">
    <div class="bao">
            <h1>爆爆团</h1>
            <p>限时爆款 超级低价</p>
    <div class="font">
        <ul>
            <li v-for="(item,index) in list" :key="index" @click="changeList(index)" :class="{active:currentIndex == index}">
            {{item}}
            </li>
        </ul>
    </div>
        </div>
    
    <div class="list">
        <ul v-show="status == false">
            <li v-for="(item,index) in shoplist" :key="index">
            <!-- <p>{{item.name}}</p> -->
            <img :src="item.picture" alt="">
            <div class="nav">
                <p class="p1">{{item.name}}</p>
                <p class="price">爆爆团价</p>
                
                <span class="p2"><span>￥</span>{{item.min_price}}</span>
                <span class="p3">{{item.promotion_info}}</span>
                <span class="btn">马上抢</span>
                <p class="p0">{{item.month_saled_content}}</p>
                

            </div>
            </li>
        </ul>
        <ul v-show="status == true">
            <li v-for="(item,index) in shoplist2" :key="index">
                <img :src="item.picture" alt="">
                <p class="p4 p1">{{item.name}}</p>
                <span class="p5 p2"><span>￥</span>{{item.min_price}}</span>
                <span class="p6 p3">{{item.promotion_info}}</span>
                <span class="btn btn1">马上抢</span>
                <p class="p7 p0">{{item.month_saled_content}}</p>
            </li>
        </ul>
    </div>
  </div>
</template>

<script>
import {shop_list,tuan_list,user_login} from '../../utils/api';

export default {
   data(){
    return{
        currentIndex:0,
        status:false,
        list:["正在抢购","上新预告"],
        shoplist:[],
        shoplist2:[]
    }
   },
   mounted(){
    tuan_list({status:0}).then((res)=>{
        // console.log(res.data);
        this.shoplist = res.data.list;
    });
    tuan_list({status:1}).then((res)=>{
        // console.log(res.data);
        this.shoplist2 = res.data.list;
        
    })
   },
   methods:{
    changeList(index){
        this.currentIndex = index;
        this.status = !this.status;
        // console.log(this.shoplist);
    }
   }
}
</script>

<style lang="scss" scoped>
/* .more{
    background-color: hotpink;
    height: 300px;
    line-height: 300px;
    text-align: center;
} */
*{
    margin: 0;
    padding: 0;
    
}
body{
    background-color: #f5f5f5;
}
.bao {
width: 100%;
height: 220px;
overflow: hidden;
background:linear-gradient(rgb(238, 68, 6),rgb(255, 174, 0));
position: relative;
}
.bao h1 {
    text-align: center;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: #fff;
    font-size: 24px;
    font-style: italic;
    margin-top: 10px;
}
.bao p {
    text-align: center;
    font-size: 28px;
    color: rgb(243, 206, 170);
    margin-top: 40px;
    font-weight: bold;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
}
.header{
    width: 100%;
    height: 100px;
    // background-color: brown;
    text-align: center;
    line-height: 150px;
    
}
.header p{
    font-size: 20px;
    font-weight: bolder;
}
.font .active{
    color: #fff;
    font-weight: bold;
    border-bottom: 2px solid #fff;

}
.font{
    position: absolute;
    bottom: 0;

}
.font li{
    width: 150px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    float: left;
    color: #fff;
    border-bottom: 2px solid transparent;
    
}
ul{
    list-style: none;
}
.list ul{
    width: 96%;
    margin: 30px 10px;
}
.list ul li{
    height: 120px;
    background-color: #fff;
    border-radius: 5px;
    width: 100%;   
}
.price{
    font-size: 12px;
    color: #ea4626;
}
img{
    width: 110px;
    height: 110px;
    
}
img:first-child{
    position: absolute;
    left: 0;
}
.nav{
    width: 60%;
    height: 100px;
    // background: yellowgreen;
    float: right;
}
.nav .footer{
    width: 100%;
    height: 30px;
    // background-color: blue;
}
.btn{
    margin-left: 80px;
    display: inline-block;
    width: 80px;
    height: 30px;
    background-color: #ea4626;
    line-height: 30px;
    text-align: center;
    border-radius: 15px;
    color: #fff;

}
.p1{
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}
.p2{
    color: #ea4626;
    font-size: 18px;
    display: inline-block;
    margin-top: 5px;
}
.p2 span{
    font-size: 12px;
}
.p0{
    font-size: 12px;
    text-align: right;
    margin-right: 40px;
}
.p3{
    width: 26px;
    height: 18px;
    font-size: 6px;
    margin-left: 4px;
    border: 1px solid #ea4626;
    border-radius: 4px;
    color: #ea4626;
    padding: 2px;
}
.p4,.p5,.p6,.p7{
    margin-left: 120px;
}
.btn1{
    float: right;
    margin-right: 30px;
}
</style>